package vn.lumi.smarthome.ui;

import kankan.wheel.widget.adapters.NumericWheelAdapter;
import android.content.Context;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class TimeAdapter extends NumericWheelAdapter {
	private int currentItem;
	private int currentValue;

	public TimeAdapter(Context context, int minValue, int maxValue,int currentItem) {
		super(context, minValue, maxValue);
		setTextSize(16);
		this.currentValue = currentItem;
	}

	@Override
	protected void configureTextView(TextView view) {
		super.configureTextView(view);
		String txt=getItemText(currentItem)+"";
		int y=Integer.parseInt(txt);
		
		if (currentItem == currentValue||(y==currentValue && y>2000)) {
			view.setTextColor(0xFF0000F0);
		}
		view.setTypeface(Typeface.SANS_SERIF);
	}
	

	@Override
	public View getItem(int index, View convertView, ViewGroup parent) {
		currentItem = index;
		return super.getItem(index, convertView, parent);
	}

}

